import Vue from 'vue'

import App from './App.vue'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import VueCodemirror from 'vue-codemirror'
import 'codemirror/lib/codemirror.css'


import mixins from './mixins'

import ajax from './utils/ajax'
import eventBus from './utils/eventBus'
import notify from './utils/notify'
import date from './utils/date'
import storage from './utils/storage'
import window from './utils/window'
import crypto from './utils/crypto'
import sequelize from './utils/sequelize'
import str from './utils/str'

Vue.mixin(mixins);

Vue.use(ElementUI);
Vue.use(VueCodemirror);
Vue.use(ajax);
Vue.use(eventBus);
Vue.use(notify);
Vue.use(date);
Vue.use(storage);
Vue.use(window);
Vue.use(crypto);
Vue.use(sequelize);
Vue.use(str);

/*const utils = path.join(__dirname, '/utils');
 fs.readdirSync(utils).forEach(util => Vue.use(require('./utils/' + util).default));*/

if (!process.env.IS_WEB) Vue.use(require('vue-electron'));
Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
    components: {App},
    router,
    store,
    template: '<App/>'
}).$mount('#app');
